package main

import "fmt"

type AInterface interface {
	Say()
}

type Stu struct {
	Name string
}

type Integer int

func (stu *Stu) Say() {
	fmt.Println("Stu Say()")
}

func (i *Integer) Say() {
	fmt.Println("Integer Say()")
}

type BInterface interface {
	Hello()
}

type Monster struct {
}

func (m Monster) Say() {
	fmt.Println("Monster Say")
}
func (m Monster) Hello() {
	fmt.Println("Monster Hello")
}

func main() {
	var stu Stu             //实现了 AInterface 接口
	var a AInterface = &stu //通过一个实例来实现
	a.Say()
	var n Integer = 10
	var b AInterface = &n
	b.Say()
	var monster Monster
	var a2 AInterface = monster
	var b2 BInterface = monster
	a2.Say()
	b2.Hello()
}
